在 C# 中,讓實值型別可以使用 null 的型別
在 C# 中,讓實值型別可以使用 null 的型別,只要再宣告變數時,加上?就可以了
int? iNull = null; 
int?[] iNullArray = new int?[10];
有時候我們可能會需要透過 if 判斷式判斷 bool 值
例如
bool  bChk = true; 
if (boolChk) 
{
}
但假如宣告為 bool? 時,就會有三種狀態,分別是 true, false, null
所以在 if 判斷式時,就不能直接拿 bool 來判斷,要把值代入作判斷
bool? bChk = true; 
if (bChk == true) 
{
}